package cn.itlaobing.dao;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * Created by lhb on 2017/12/1.
 */
@Repository
public class UserDaoImple implements UserDao {
    Logger logger=Logger.getLogger(this.getClass());
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public void save(String name) {
        String sql="insert into users (id,name) values(seq_users_id.nextval,?)";
        jdbcTemplate.update(sql,name);
        logger.info("dao中保存name"+name);
    }
}
